package router

import (
	"batbat-backend/app/api"
	"batbat-backend/app/service"
	"github.com/gogf/gf/frame/g"
	"github.com/gogf/gf/net/ghttp"
)

// 用户接口路由
func init() {
	g.Server().Group("/user", func(group *ghttp.RouterGroup) {
		group.Middleware(service.Middleware.Login)

		group.GET("/", api.User.GetInformation).Middleware(service.Middleware.NeedLogin)
		group.GET("/:id", api.User.GetUser).Middleware(service.Middleware.NeedLogin)
		group.GET("/:id/favor", api.User.GetUserFavor)
		group.POST("/", api.User.Register)
		group.PUT("/", api.User.ModifyInformation).Middleware(service.Middleware.NeedLogin)
		group.GET("/:id/review", api.User.Reviews)
	})
}
